import Home from '../home/home';

import User from './user';
import Msg from './msg/';
import Scan from './scan';
import Search from './search';
import Order from './order';
import {ScrollView, StyleSheet, Text, Image} from 'react-native';
import {TabNavigator, SafeAreaView,TabBarBottom} from 'react-navigation';
import {Thumbnail,Root,Icon} from '../../lib/components.js';

import React, {Component} from 'react';

export default  TabNavigator({

        User: {
            screen: User,
            navigationOptions: ({navigation}) => ({
                tabBarLabel: '我的',
                tabBarIcon: ({ tintColor, focused }) => (
                    <Icon
                        name={focused ? 'ios-settings' : 'ios-settings-outline'}
                        size={26}
                        style={{ color: tintColor }}
                    />
                ),
            })
        },
        Order: {
            screen: Order,
            navigationOptions: ({navigation}) => ({
                tabBarLabel: `订单`,
                tabBarIcon: ({ tintColor, focused }) => (
                    <Icon
                        name={focused ? 'ios-cart' : 'ios-cart-outline'}
                        size={26}
                        style={{ color: tintColor }}
                    />
                ),
            })
        },
        Scan: {
            screen: Scan,
            navigationOptions: {
                tabBarLabel: '扫码',
                tabBarIcon: ({ tintColor, focused }) => (
                    <Icon
                        name={focused ? 'ios-qr-scanner' : 'ios-qr-scanner-outline'}
                        size={26}
                        style={{ color: tintColor }}
                    />
                ),
            }
        },
        Home: {
            screen: Home,
            navigationOptions: {
                tabBarLabel: '首页',
                tabBarIcon: ({ tintColor, focused }) => (
                    <Icon
                        name={focused ? 'ios-home' : 'ios-home-outline'}
                        size={26}
                        style={{ color: tintColor }}
                    />
                ),
            }

        },

        Msg: {
            screen: Msg,
            navigationOptions: {
                title: '消息',
                tabBarLabel: '消息',
                tabBarIcon: ({ tintColor, focused }) => (
                    <Icon
                        name={focused ? 'ios-chatboxes' : 'ios-chatboxes-outline'}
                        size={26}
                        style={{ color: tintColor }}
                    />
                ),
            },
            mode: 'modal',
            headerMode: 'screen'
        },

    },
    {
        mode: 'modal',
        headerMode: 'none',
        initialRouteName: 'User',
        tabBarOptions: {
            activeTintColor: 'tomato',
            inactiveTintColor: 'gray',
        },
        tabBarComponent: TabBarBottom,
        tabBarPosition: 'bottom',
        animationEnabled: false,
        swipeEnabled: false,
    });


